package com.petshop.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.common.constant.BalzLogger;
import com.common.constant.URLConstant;

public class LogoutServlet extends HttpServlet {
	
	BalzLogger logger = new BalzLogger();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		logger.info("LogoutServlet", "LOG OUT !!");
		
		HttpSession session = request.getSession();
		session.invalidate();				
		
		RedirectPage redirectPage = new RedirectPage();
		redirectPage.forward(request, response, URLConstant.PAGE_LOGIN);
	}	
	
}
